﻿using SqlSugar;

namespace CarAppDomain.Base
{
    /// <summary>
    /// 基类
    /// </summary>
    public class BaseEntity
    {
        public BaseEntity()
        {
            this.DeleteFlag = false;
            this.CreateTime = DateTime.Now;
            this.Id = Guid.NewGuid().ToString();
        }
          
        /// <summary>
        ///主键
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar", Length = 36, IsPrimaryKey = true, IsIdentity = false, ColumnDescription = "主键")]
        public string? Id { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar", Length = 64, IsNullable = false, ColumnDescription = "创建人")]
        public string? CreateUser { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnDataType = "datetime", IsNullable = false, ColumnDescription = "创建时间")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar", Length = 64, IsNullable = true, ColumnDescription = "修改人")]
        public string? UpdateUser { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [SugarColumn(ColumnDataType = "datetime", IsNullable = true, ColumnDescription = "修改时间")]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [SugarColumn(ColumnDataType = "bit", IsNullable = false, ColumnDescription = "是否删除")]
        public bool DeleteFlag { get; set; }
    }
}
